package com.platform.car.controller;

import com.platform.car.model.Parkingpay;
import com.platform.car.service.ParkingpayService;
import com.platform.common.config.Global;
import com.platform.common.page.Page;
import com.platform.common.utils.UserUtils;
import com.platform.upms.model.UpmsUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/car/parkingpay")
public class ParkingpayController {

    @Autowired
    ParkingpayService parkingpayService;

    /**
     * 支付列表，带分页
     * @param page
     * @param parkingpay
     * @param modelMap
     * @return
     */
    @RequestMapping(value = "/list")
    public String list(Page<Parkingpay> page, Parkingpay parkingpay, ModelMap modelMap, HttpSession session){
        if(!UserUtils.isHighestPower()) {
            parkingpay.setOrgId(UserUtils.getUserOrgId());
        }
        Page<Parkingpay> parkingpayList = parkingpayService.findByPage(page,parkingpay);
        modelMap.addAttribute("parkingpayList",parkingpayList);
        return  "/car/parkingpay/list.jsp";
    }
}
